package com.dailyblue.java.project.smbms.provider.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dailyblue.java.project.smbms.provider.bean.Provider;
import com.dailyblue.java.project.smbms.provider.mapper.ProviderMapper;
import com.dailyblue.java.project.smbms.provider.service.ProviderService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

@Service
public class ProviderServiceImpl extends ServiceImpl<ProviderMapper, Provider> implements ProviderService {
    @Resource
    private ProviderMapper providerMapper;

    @Cacheable(cacheNames = "findProviderById",key = "#id")
    public Provider getById(Serializable id) {
        return super.getById(id);
    }

    @Cacheable(cacheNames = "findBySelect",key = "0")
    public List<Provider> findBySelect() {
        return providerMapper.findBySelect();
    }
}
